<!DOCTYPE html>
<html lang="{{ .Site.Language.Lang }}">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  {{ with .Site.Params.author }}
  <meta name="author" content="{{ . }}">{{ end }}
  {{ if .Description }}
  <meta name="description" content="{{ .Description }}">
  {{else}}
  <meta name="description" content="{{ block "description" . }}{{ .Site.Params.description }}{{ end }}">
  {{ end }}
  {{ if .Keywords }}
  <meta name="keywords" content="{{ delimit .Keywords ", " }}">
  {{else}}
  {{ with .Site.Params.keywords }}
  <meta name="keywords" content="{{ . }}">{{ end }}
  {{ end }}

  {{ template "_internal/twitter_cards.html" . }}
  {{ template "_internal/opengraph.html" . }}

  {{ partial "schema.html" . }}

  {{ if .Permalink }}
  <base href="{{ .Permalink }}">
  {{ end }}
  <title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>

  {{ if .Permalink }}
  <link rel="canonical" href="{{ .Permalink }}">
  {{ end }}

  <link href="https://fonts.googleapis.com/css?family=Lato:400,700%7CMerriweather:300,700%7CSource+Code+Pro:400,700&display=swap"
    rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
    integrity="sha256-l85OmPOjvil/SOvVt3HnSSjzF1TUMyT9eV0c2BzEGzU=" crossorigin="anonymous" />

  {{ if .Site.IsServer }}
  {{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
  {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }}
  <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
  {{ else }}
  {{ $cssOpts := (dict "targetPath" "css/coder.css" ) }}
  {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts | minify | fingerprint }}
  <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}"
    crossorigin="anonymous" media="screen" />
  {{ end }}

  {{ if .Site.Params.rtl }}
  {{ if .Site.IsServer }}
  {{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" "enableSourceMap" true ) }}
  {{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts }}
  <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
  {{ else }}
  {{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" ) }}
  {{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts | minify | fingerprint }}
  <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}"
    crossorigin="anonymous" media="screen" />
  {{ end }}
  {{ end }}

  {{ if  or (eq .Site.Params.colorscheme "auto") (eq .Site.Params.colorscheme "dark") }}
  {{ if .Site.IsServer }}
  {{ $cssOpts := (dict "targetPath" "css/coder-dark.css" "enableSourceMap" true ) }}
  {{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts }}
  <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
  {{ else }}
  {{ $cssOpts := (dict "targetPath" "css/coder-dark.css" ) }}
  {{ $styles := resources.Get "scss/coder-dark.scss" | resources.ExecuteAsTemplate "style.coder-dark.css" . | toCSS $cssOpts | minify | fingerprint }}
  <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}"
    crossorigin="anonymous" media="screen" />
  {{ end }}
  {{ end }}

  {{ range .Site.Params.custom_css }}
  <link rel="stylesheet" href="{{ . | relURL }}" />
  {{ end }}

  {{ range .Site.Params.custom_js }}
  <script src="{{ . | relURL }}" async></script>
  {{ end }}

  <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_32 | default "/images/favicon-32x32.png" | absURL }}"
    sizes="32x32">
  <link rel="icon" type="image/png" href="{{ .Site.Params.favicon_16 | default "/images/favicon-16x16.png" | absURL }}"
    sizes="16x16">

  {{ range .AlternativeOutputFormats -}}
  {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
  {{ end -}}

  {{ hugo.Generator }}

  <meta name="baidu-site-verification" content="TiReu51WyJ" />

  {{ $tag_sass := resources.Get "scss/tagcloud.scss" }}
  {{ $tag_style := $tag_sass | toCSS }}
  <link rel="stylesheet" href="{{ $tag_style.RelPermalink }}" media="screen" />

</head>

{{ $csClass := "colorscheme-light" }}
{{ if eq .Site.Params.colorscheme "dark" }}
{{ $csClass = "colorscheme-dark" }}
{{ else if eq .Site.Params.colorscheme "auto" }}
{{ $csClass = "colorscheme-auto" }}
{{ end }}

<body class="{{ $csClass }}{{ if .Site.Params.rtl }} rtl{{ end }}">
  <main class="wrapper">
    {{ partial "header.html" . }}

    <div class="content">
      {{ block "content" . }}{{ end }}
    </div>

    {{ partial "footer.html" . }}
  </main>

  <!-- Global site tag (gtag.js) - Google Analytics -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=UA-154678195-1"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag() { dataLayer.push(arguments); }
    gtag('js', new Date());

    gtag('config', 'UA-154678195-1');
  </script>
  <!-- Global site tag (gtag.js) - Google Analytics -->

  <!-- start webpushr code -->
  <script>(function(w,d, s, id) {w.webpushr=w.webpushr||function(){(w.webpushr.q=w.webpushr.q||[]).push(arguments)};var js, fjs = d.getElementsByTagName(s)[0];js = d.createElement(s); js.id = id;js.src = "https://cdn.webpushr.com/app.min.js";fjs.parentNode.appendChild(js);}(window,document, 'script', 'webpushr-jssdk'));webpushr('init','BHuwaXciWicBjh6HQS2tfudv6IYQD11K9u1NUj7nuaEV9NoDT7ns9JjgqyYTflUv-m3TlD7ELY84AHMfgmPXNgU');</script>
  <!-- end webpushr code -->

</body>

</html>
